package info.hengha.demo;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//@WebServlet(name="HelloServlet", urlPatterns="/hello")
public class HelloServlet extends HttpServlet {

    private static final long serialVersionUID = 64L;

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        //String servletName=servletConfig.getServletName();
        String userName = request.getParameter("name");
        response.setContentType("text/html");
        PrintWriter writer = response.getWriter();
        writer.print("<html><head></head><body><h1>" + userName + "</h1></body></html>");
    }
}
